/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ecommerce.model;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author Hadi
 */
@Entity
@Table(name ="T_PAYMENT")
public class Payment implements Serializable {

    @Id
    @GeneratedValue
    private Long id;


    private MethodPayment method;
    private String notes;

    @ManyToOne()
    @JoinColumn(name="customer_id", nullable=false)
    private Customer customer;

    @OneToOne
    @JoinColumn(name="order_id")
    private Order order;

    public Customer getCustomer() {
        return customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public MethodPayment getMethod() {
        return method;
    }

    public void setMethod(MethodPayment method) {
        this.method = method;
    }

    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    public Order getOrder() {
        return order;
    }

    public void setOrder(Order order) {
        this.order = order;
    }
}
